
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
    <script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.js"></script>
</head>
<body>
    <h2 style="text-align:center;letter-spacing:40px;color:pink">欢迎来到添加新闻界面</h2>
    <div>
        <img src="../images/news1.png" style="width:100% ;height:150px">
    </div>
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">添加新闻</h3>
            </div>
            <div class="panel-body">
                <form role="form" action="AddNewsServlet" method="post">
                    <input type="hidden" name="adduserId" value="${userLogin.userId}" />
                    <div class="form-group">
                        <label for="title">新闻标题</label>
                        <input type="text"  <c:if test="${params eq 'updatenews' }"> value="${newsdemo.title }" </c:if>
                               class="form-control" id="title" name="title" placeholder="新闻标题">
                    </div>
                    <div class="form-group">
                        <select name="boardId">
                            <option>--请选择板块名字--</option>
                            <c:forEach items="${listboard}" var="board">
                                <option value="${board.boardId}">${board.boardName}</option>
                            </c:forEach>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="context">新闻内容</label>
                        <input type="text" <c:if test="${params eq 'updatenews' }"> value="${newsdemo.context }" </c:if>
                               class="form-control" id="context" name="context" placeholder="新闻内容">
                    </div>
                    <button type="submit" class="btn btn-primary btn-sm active">确认添加</button>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
